package cn.jasonone.jame;

import javafx.beans.property.BooleanProperty;
import javafx.beans.property.SimpleBooleanProperty;

/**
 * 调试帮助类
 *
 * @author Jason
 * @since 1.0.0
 */
public class DebugHelper {

    private static final BooleanProperty fps = new SimpleBooleanProperty(false);
    private static final BooleanProperty spirit = new SimpleBooleanProperty(false);
    private static final BooleanProperty keyListener = new SimpleBooleanProperty(false);
    private static final BooleanProperty mouseListener = new SimpleBooleanProperty(false);
    private static final BooleanProperty border = new SimpleBooleanProperty(false);

    public static BooleanProperty fpsProperty() {
        return fps;
    }

    public static BooleanProperty spiritProperty() {
        return spirit;
    }

    public static BooleanProperty keyListenerProperty() {
        return keyListener;
    }

    public static BooleanProperty mouseListenerProperty() {
        return mouseListener;
    }

    public static BooleanProperty borderProperty() {
        return border;
    }

    /**
     * 开启FPS显示
     * @return {@code true or false}
     */
    public static boolean isFps() {
        return fps.get();
    }

    /**
     * 是否开启FPS
     * @param fps {@code true or false}
     */
    public static void setFps(boolean fps) {
        DebugHelper.fps.set(fps);
    }

    /**
     * 是否显示精灵数量
     * @return {@code true or false}
     */
    public static boolean isSpirit() {
        return spirit.get();
    }

    /**
     * 是否开启精灵数量显示
     * @param spirit {@code true or false}
     */
    public static void setSpirit(boolean spirit) {
        DebugHelper.spirit.set(spirit);
    }

    /**
     * 是否显示按键事件数量
     * @return {@code true or false}
     */
    public static boolean isKeyListener() {
        return keyListener.get();
    }

    /**
     * 是否开启按键事件数量显示
     * @param keyListener {@code true or false}
     */
    public static void setKeyListener(boolean keyListener) {
        DebugHelper.keyListener.set(keyListener);
    }

    /**
     * 是否显示鼠标事件数量
     * @return {@code true or false}
     */
    public static boolean isMouseListener() {
        return mouseListener.get();
    }

    /**
     * 是否开启鼠标事件数量显示
     * @param mouseListener {@code true or false}
     */
    public static void setMouseListener(boolean mouseListener) {
        DebugHelper.mouseListener.set(mouseListener);
    }

    /**
     * 是否显示精灵边界
     * @return {@code true or false}
     */
    public static boolean isBorder() {
        return border.get();
    }

    /**
     * 是否开启精灵边界显示
     * @param border {@code true or false}
     */
    public static void setBorder(boolean border) {
        DebugHelper.border.set(border);
    }
}
